<?php

class Core_Backend_Component_Foundation_View_Helper_Poi_Browser extends Core_Backend_Component_Foundation_View_Poi_Index {
	
	protected function initialize(){
		parent::initialize();
		$this->setTemplatePath('browser');
	}

    protected function buildToolbar($toolbar) {
        $group = $toolbar->createGroup('selector');
        $group->addButton($this->__('share.button.selectAll'))
                ->bindEvent('click', "Kdf.Ui.getGrid('choose_poi_grid').selectAll()");
        $group->addButton($this->__('share.button.cancelSelected'))
                ->bindEvent('click', "Kdf.Ui.getGrid('choose_poi_grid').cancelSelected()");
        $group->addButton($this->__('share.button.selectInverse'))
                ->bindEvent('click', "Kdf.Ui.getGrid('choose_poi_grid').selectInverse()");

        $group = $toolbar->createGroup('filter');
        $group->addButton($this->__('share.button.filter'))
              ->bindEvent('click', "Kdf.Ui.getForm('choose_poi_form').submit()");
        $group->addButton($this->__('share.button.clear_filter'))
              ->bindEvent('click', "clearForm()");
        $group = $toolbar->createGroup();
        $group->addButton($this->__('share.button.ok'))
              ->bindEvent('click', 'chooseMulti()');
    }

    public function buildGrid($grid) {
        $this->getTemplate()->assignMulti($this->getAllData());
//        parent::buildGrid($grid);
//        $grid->setAllowFilter(FALSE);
//        $grid->removeColumn('users');
//        $grid->setId('choose_poi_grid')
//             ->addButtonColumn('#', 'choose', 'returnChoose(this)', $this->__('share.button.choose'))
//                ->setWidth(50)
//                ->setAlign('center');
//        if($this->getRoad()){
//            $grid->getColumn('districtname')->removeFilter();
//            $grid->getColumn('townstreetname')->removeFilter();
//            $grid->getColumn('roadname')->removeFilter();
//        }
    }
}

